~include file="header.html" tit = $tit head=$head zzurl=$zzurl isvisitor=$isVisitor userinfo=$userinfo~~

<title>修改密码 - ~$tit~~</title>~include file="head.html" tit = $tit head=$head zzurl=$zzurl isvisitor=$isVisitor userinfo=$userinfo~~
<style type="text/css">

</style>
<div class="container">
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4">
<br><br><br>
<div class="well bs-component"style="padding: 0px;">
<div class="uhead" align="center">
<div class="gravatar">
  <img src="https://cn.gravatar.com/avatar/~$mailhash~~?s=80&r=g"  class="img-circle"><div class="info">~$userinfo['username']~~</div>
  </div>
</div>
<div  style="margin-left:29px;margin-right:29px;">
<div class="row">
<h3 >修改密码</h3>
 <form id="cp">
 <div style="height: 20px;"></div>
 <div class="form-group label-floating">
  <label class="control-label" for="focusedInput1">请输入您当前的密码：</label>
  <input class="form-control" name="pwdnow" type="password">
</div>
 <div style="height: 20px;"></div>
 <div class="form-group label-floating">
  <label class="control-label" for="focusedInput1">请输入要设置的新密码：</label>
  <input class="form-control" name="pwdnew" type="password">
</div>
 <div style="height: 20px;"></div>
 <div class="form-group label-floating">
  <label class="control-label" for="focusedInput1">请再输一遍新密码：</label>
  <input class="form-control" name="pwdcheck" type="password">
</div>
 </form>
 <div align="right">
       <a id="s1" onclick="changepwd()"  class="btn btn-raised btn-primary">提交更改</a>
       </div>
</div>
<br>
</div>


        </div>
        <div class="col-md-4"></div>
    </div>
    </div>
    <br><br><br>
    ~include file="footer.html" titm = $tit head=$head zzurl=$zzurl isvisitor=$isVisitor userinfo=$userinfo~~
    <script type="text/javascript" src="~$zzurl~~content/themes/material/js/ZeroClipboard.js"></script>
<script type="text/javascript" src="~$zzurl~~content/themes/material/js/login.js"></script> 
<script type="text/javascript">
function changepwd(){
	 var pwdnow = $('input[name="pwdnow"]').val();
  var pwdnew = $('input[name="pwdnew"]').val();
  var pwdcheck = $('input[name="pwdcheck"]').val();
  if(pwdnew == pwdcheck){
        $.post("../includes/userAction.php", {
            pwd: pwdnew,
            pwdnow:pwdnow,
            action: "changepwd"
        }, function(data) {
            var pe = data.split(".");
            if (pe[0] == "ok") {
                $.snackbar({
                        content: pe[1],
                        timeout: 2000
                    });
                setTimeout(function() {
                        window.location.reload();
                    }, 2000);
            } else {
                $.snackbar({
                        content: pe[1],
                        timeout: 2000
                    });
            };
        });
  }else{
$.snackbar({
                        content: "两次输入密码不一致",
                        timeout: 2000
                    });
  }
}
    
</script>